import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:xindong/routes/tab_home/view/xindong_user_list_cell.dart';
import 'package:xindong/routes/user/follow/xindong_fans_vm.dart';
import 'package:xindong/widgets/common/xindong_app_bar.dart';
import 'package:xindong/widgets/container/xindong_empty_container.dart';
import 'package:xindong/widgets/container/xindong_getx_builder_container.dart';

class XinDongFansYeMian extends StatelessWidget {
  const XinDongFansYeMian({super.key});

  @override
  Widget build(BuildContext context) {
    final controller = Get.put(XinDongFansVM());
    return Scaffold(
      appBar: XinDongAppBar("粉丝"),
      body: XinDongGetBuilder<XinDongFansVM>(builder: (viewClass) {
        return XinDongRefreshContainer(
          viewClass: viewClass,
          child: XinDongEmptyContainer(
            dataList: viewClass.dataList,
            emptyTips: "还没有用户关注您哦～",
            child: ListView.separated(
              itemCount: viewClass.dataList?.length ?? 0,
              itemBuilder: (BuildContext context, int index) {
                final model = viewClass.dataList![index];
                return XinDongUserListCell(model: model);
              },
              separatorBuilder: (BuildContext context, int index) {
                return const SizedBox(height: 1);
              },
            ),
          ),
        );
      }),
    );
  }
}
